# encoding: utf-8
import datetime
import json
import time
from pytz import timezone
import urllib.parse as parse
import re
from math import ceil
from multiprocessing import Pool
from lxml import html
import pandas as pd
# from fake_useragent import UserAgent
from xlutils.copy import copy
from xlrd import open_workbook
from sql_ac.sql_1 import select_all, insert_merberid
import execjs
import requests
import io
import sys

sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='gb18030')

# c = UserAgent()
'''请求'''
kv = {
    # 'user-agent': c.random,
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36',
    # 'referer': 'https://fanyi.baidu.com/?aldtype=16047',
    # 'origin': 'https://fanyi.baidu.com',
    # 'host':'fanyi.baidu.com',
    # 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
    # 'cookie': 'cna=cnkGGZFaLn0CAXFbPOPPTNea; UM_distinctid=1799d7207f2a50-0f1302f62cbbe6-31614c0c-1fa400-1799d7207f3a28; ubt_ssid=mgg57l8zli4gob9xi2m6qaon1suy81l0_2021-05-24; perf_ssid=m9xylundpvt7c1yd7isffoxey0grxmm9_2021-05-24; _bl_uid=b3kbjpzw2U2cXe7mbc4hsd9qtzCj; track_id=1621999343|53c1cd0f9fa3a73a108025d5c186016cd783532d2098be9afe|7273ba4595a383f6aa4246aea2a20ffe; USERID=3404782426; tzyy=e220227ef03ded06263f75390f3ba38e; t=58d9f0ad6cbe46f5b4157c60a3add354; t_eleuc4=id4=0%40BA%2FvuHCrrRjyKZTeObIhgi%2FM7%2FpsDdCrv041IQ%3D%3D; unb=2205563019926; _samesite_flag_=true; cookie2=16dec8a09681df428e6f770c063a94b7; _tb_token_=f93710b3eee3e; UTUSER=3404782426; xlly_s=1; nr_security_map_key=ad1e1925-8831-4150-b2a9-7d23f50724e1; FAAS_GRAY_ID=14; _m_h5_tk=1b5921323129593b51aa22224d13008e_1622005325694; _m_h5_tk_enc=fabb8f228c0e5813ed99f3ac0302f701; NR_SHOP_AB=0; _orbit_h5_utils_channel_=mobile.antispider.default.1621996687805; SID=LgAAAADK8Nta-gAEAACGUZmye0Orww5IQOF4Wm-yTnu8siVwumBgIflb; ZDS=1.0|1621997106|QBeXsloAFwIZcsupy51XDPutmXqv2ut2TbwJ571UYCWmTGziYtwGASwq4NASYokVab9lTT4cFs/elpGSwKMiaQ==; x5check_ele=dSTGQhvy6PL0nVoTg3AyATYgZnTx6M0sQSwcFLghuJw%3D; l=eBjP3NCrjnvpimSwBOfZnurza779IIRRguPzaNbMiOCPOM5w8TrfB6sIIcLeCnGRnswDR3WHtryzBvTg3PzihOGoURfO0Zs-3dRC.; tfstk=cLwOB7c_1wbM1knL45ChhQCV4ZzOZ1UwaluCXXRdKldJf2vAiXwue7Gk7DiKZMC..; isg=BDU16AEuuVmVs93jeOhDLUE9RLHvsunEUTasXbda86zWjlGAfwGbl_dI3HS4zgF8',
    'cookie': 'BIDUPSID=F3FC67F00CCE214C2696C33363B05E99; PSTM=1627290386; BAIDUID=F3FC67F00CCE214CBE804B6ADDA31B6C:FG=1; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; H_WISE_SIDS=107314_110085_127969_132549_164869_171235_174331_175758_176121_176399_176678_177094_177371_177414_178023_178330_178529_178540_178646_179001_179227_179350_179402_179421_179459_180112_180328_180409_180434_180436_180641_180654_180699_180749_180754_180801_180822_180868_180890_180936_181108_181126_181207_181261_181322_181327_181398_181428_181431_181484_181610_181649_181664_181799_182024_182062_182217_182248_182273_182283_182331_182366_182411_182612; H_PS_PSSID=34299_34099_34272_31254_34276_33848_34072_34283_34284_26350_34244; BDUSS=kxbjZVRzJkUEk0S2w0aXg5dzZjTE5IckxPfjlJSWpJTEs3WmdNbTNlTzdDU1poSUFBQUFBJCQAAAAAAAAAAAEAAAD2vuuauf65~sqlttwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALt8~mC7fP5gM3; BDUSS_BFESS=kxbjZVRzJkUEk0S2w0aXg5dzZjTE5IckxPfjlJSWpJTEs3WmdNbTNlTzdDU1poSUFBQUFBJCQAAAAAAAAAAAEAAAD2vuuauf65~sqlttwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALt8~mC7fP5gM3; BDSFRCVID=mALOJeCT5G3_WP5eplS1UGRA5eKKN9OTTPjcTR5qJ04BtyCVNKsaEG0PtOgMNBDbJ2MRogKK3gOTH4PF_2uxOjjg8UtVJeC6EG0Ptf8g0M5; H_BDCLCKID_SF=tJ4toCPMJI_3fP36q45HMt00qxby26nBMm79aJ5nQI5nhU7505oqK-Am3JoxQf_t5m3i2DTvQUbmjRO206oay6O3LlO83h5wW57KKl0MLPbcep68LxODy6DI0xnMBMPe52OnaIbx3fAKftnOM46JehL3346-35543bRTLnLy5KJYMDFRDTAWj5cBDGRb54cQ265tWjrya4nVhDDlqROoK5P0hho9BtQmJJrHabKhbK3qqbR3yqon0xo0bq8qK-JaQg-q3R76th6HjKbgbCcTDUKv2lok0x-jLPjPVn0MW-5YqnjchPnJyUnybPnnBT3T3H8HL4nv2JcJbM5m3x6qLTKkQN3T-PKO5bRh_CF-tIKabKtmD6Rb5nbH-xQ0KnLXKKOLVb6pBp7keqO2jft5Bp-rjfoj2ptDQmvN5C5HWhvFbq723h38-p0wjqQZJT3GbT5m-qrc-bjpsIJM5MnJXfCYQM5ZJfrNaKviaKOjBMb1MMJDBT5h2M4qMxtOLR3pWDTm_q5TtUJMeCnTDMFhe4tX-NFJq60eJfK; __yjs_duid=1_11a2a54a490ac980c561e45ba86d75061627366749874; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1627379866; HISTORY_SWITCH=1; SOUND_SPD_SWITCH=1; FANYI_WORD_SWITCH=1; REALTIME_TRANS_SWITCH=1; SOUND_PREFER_SWITCH=1; BDSFRCVID_BFESS=mALOJeCT5G3_WP5eplS1UGRA5eKKN9O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jFjYmJhM2I5ZmM0MzQwOWY2Y2UyNjhmYTk5NTM4YzdlMDVjM2YyODhlNzFjZjA0OTg5YzVhYmRiZTViNWMyNDk1MjY4Y2VlZGIyMWRhNGZmMjEyMjk5NTUwOWNlZTAwNDkwMWU3YmNiNzk3Y2VlNDA0NDY2MjZiNDhmOTQ5YTRlN2NmNjQxODUzNTA5N2Y2MzFiY2MyZmFmZjVhZTU3YWRiZTU5NzNmZDdkNTkxMGM5NzBkMmY0NDA4MmRiOGM4ZDVlNzFkOGZiOTNkZmUwY2VlYjM1NTU3MjczOWZlZDAxNGRkYTYzMDc2MjhmNDQxNTY2Ml83X2MxMDcwNTg1'
}
da = {
    'countrycode': '86',
    'email': '17346978542',
    'password': 'ZzRH+fnpgXOMCgg7a/eu03Up5VT0sq/mMIcBuBDHPY=',
    'origin': 'account-login',
    'csrf': 'tT1uwlfT-1Sz_p2x2hYXz6GRcX19ut0FOM4w',
    'requestCode': '',
    'h5Fingerprint': '',
    'device_name': '',
    'device_type': 'Chrome',
    'device_os': 'Window',
    'sdkType': 'pc'
}
da1 = {"currentPage": 2, "pageSize": 10}


def jie(ee):
    with open('yrx/js_nx/dazhong/baidu_fyi.js', 'r', encoding='gbk') as f:
        jstext = f.read()
    ctx = execjs.compile(jstext)
    result = ctx.call('oo', ee)
    return result


# r = requests.post('https://hr.163.com/api/hr163/position/queryPage', headers=kv, data=json.dumps(da1))
# print(r.text)
# https://shopping.ele.me/h5/mtop.venus.shopservice.getshopinfo/1.1/?jsv=3.0.0&appKey=12574478&t=1621943182467&sign=7bfae5c973f6627583eaf3943b88287c&type=originaljson&valueType=original&isUseH5Request=true&api=mtop.venus.ShopService.getShopInfo&v=1.1&windVaneOptions=%5Bobject%20Object%5D&ttid=h5%40pc_chrome_89.0.4389.114&data={"storeId":"240152308","version":"1.1","livingShowChannel":"others","deviceId":"BC9F2E69A33C4235B20549A721D81457|1621844346620","lat":22.648354,"lng":114.212844,"latitude":22.648354,"longitude":114.212844,"cityId":11,"bizChannel":"mobile.antispider.default"}
# print(time.time())
# cook = {'BIDUPSID': 'F3FC67F00CCE214C2696C33363B05E99', 'PSTM': '1627290386', 'BAIDUID': 'F3FC67F00CCE214CBE804B6ADDA31B6C:FG',
#         'BDORZ': 'B490B5EBF6F3CD402E515D22BCDA1598',
#         'H_WISE_SIDS': '107314_110085_127969_132549_164869_171235_174331_175758_176121_176399_176678_177094_177371_177414_178023_178330_178529_178540_178646_179001_179227_179350_179402_179421_179459_180112_180328_180409_180434_180436_180641_180654_180699_180749_180754_180801_180822_180868_180890_180936_181108_181126_181207_181261_181322_181327_181398_181428_181431_181484_181610_181649_181664_181799_182024_182062_182217_182248_182273_182283_182331_182366_182411_182612',
#         'H_PS_PSSID': '34299_34099_34272_31254_34276_33848_34072_34283_34284_26350_34244',
#         'BDUSS': 'kxbjZVRzJkUEk0S2w0aXg5dzZjTE5IckxPfjlJSWpJTEs3WmdNbTNlTzdDU1poSUFBQUFBJCQAAAAAAAAAAAEAAAD2vuuauf65~sqlttwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALt8~mC7fP5gM3',
#         'BDUSS_BFESS': 'kxbjZVRzJkUEk0S2w0aXg5dzZjTE5IckxPfjlJSWpJTEs3WmdNbTNlTzdDU1poSUFBQUFBJCQAAAAAAAAAAAEAAAD2vuuauf65~sqlttwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALt8~mC7fP5gM3',
#         'BDSFRCVID': 'mALOJeCT5G3_WP5eplS1UGRA5eKKN9OTTPjcTR5qJ04BtyCVNKsaEG0PtOgMNBDbJ2MRogKK3gOTH4PF_2uxOjjg8UtVJeC6EG0Ptf8g0M5',
#         'H_BDCLCKID_SF': 'tJ4toCPMJI_3fP36q45HMt00qxby26nBMm79aJ5nQI5nhU7505oqK-Am3JoxQf_t5m3i2DTvQUbmjRO206oay6O3LlO83h5wW57KKl0MLPbcep68LxODy6DI0xnMBMPe52OnaIbx3fAKftnOM46JehL3346-35543bRTLnLy5KJYMDFRDTAWj5cBDGRb54cQ265tWjrya4nVhDDlqROoK5P0hho9BtQmJJrHabKhbK3qqbR3yqon0xo0bq8qK-JaQg-q3R76th6HjKbgbCcTDUKv2lok0x-jLPjPVn0MW-5YqnjchPnJyUnybPnnBT3T3H8HL4nv2JcJbM5m3x6qLTKkQN3T-PKO5bRh_CF-tIKabKtmD6Rb5nbH-xQ0KnLXKKOLVb6pBp7keqO2jft5Bp-rjfoj2ptDQmvN5C5HWhvFbq723h38-p0wjqQZJT3GbT5m-qrc-bjpsIJM5MnJXfCYQM5ZJfrNaKviaKOjBMb1MMJDBT5h2M4qMxtOLR3pWDTm_q5TtUJMeCnTDMFhe4tX-NFJq60eJfK',
#         '__yjs_duid': '1_11a2a54a490ac980c561e45ba86d75061627366749874', 'Hm_lvt_64ecd82404c51e03dc91cb9e8c025574': '1627379866', 'HISTORY_SWITCH': '1',
#         'SOUND_SPD_SWITCH': '1', 'FANYI_WORD_SWITCH': '1', 'REALTIME_TRANS_SWITCH': '1', 'SOUND_PREFER_SWITCH': '1',
#         'BDSFRCVID_BFESS': 'mALOJeCT5G3_WP5eplS1UGRA5eKKN9OTTPjcTR5qJ04BtyCVNKsaEG0PtOgMNBDbJ2MRogKK3gOTH4PF_2uxOjjg8UtVJeC6EG0Ptf8g0M5',
#         'H_BDCLCKID_SF_BFESS': 'tJ4toCPMJI_3fP36q45HMt00qxby26nBMm79aJ5nQI5nhU7505oqK-Am3JoxQf_t5m3i2DTvQUbmjRO206oay6O3LlO83h5wW57KKl0MLPbcep68LxODy6DI0xnMBMPe52OnaIbx3fAKftnOM46JehL3346-35543bRTLnLy5KJYMDFRDTAWj5cBDGRb54cQ265tWjrya4nVhDDlqROoK5P0hho9BtQmJJrHabKhbK3qqbR3yqon0xo0bq8qK-JaQg-q3R76th6HjKbgbCcTDUKv2lok0x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QxNTY2Ml83X2MxMDcwNTg1'}
# print(requests.post('https://fanyi.baidu.com/v2transapi?from=zh&to=en', headers=kv,data=data).json())
'''添加关键字'''
# l_name = ["序号", "名称"]
# rb = open_workbook(r"C:\Users\\Administrator\Desktop\sd.xls")
# rs = rb.sheet_by_index(0)
# wb = copy(rb)
# ws = wb.get_sheet(0)
# for i, j in zip(range(2), l_name):
#     ws.write(0, i, j)
#
# def url_list(j):
#     df = pd.read_excel('C:\\Users\\\Administrator\\Desktop\\'+j+'.xls', usecols=[2],names=None)
#     # 读取项目名称列,不要列名
#     df_li = df.values.tolist()
#     result = []
#     for s_li in df_li:
#         result.append(s_li[0])
#     return result
# def url_list1(j):
#     df = pd.read_excel('C:\\Users\\\Administrator\\Desktop\\'+j+'.xls', usecols=[1],names=None)
#     # 读取项目名称列,不要列名
#     df_li = df.values.tolist()
#     result = []
#     for s_li in df_li:
#         result.append(s_li[0])
#     return result
# d=[]
# for i in url_list1('merberid'):
#     d.append(i)
# for j in url_list('关键字'):
#     if j not in d:
#         d.append(j)
#         insert_merberid(j,'')
#         print(j)
'''市区'''
# a = ''
# for i in open('baidu_map/市区.txt', encoding='utf-8'):
#     a += i
# d = json.loads(a)
# li = []
#
# def d1(e,f):
#     for i in e['children']:
#         li.append(f+':'+i['name'])
#         for j in i:
#             if j == 'children':
#                 d1(i,f+':'+i['name'])
#
# for i in d:
#     # li.append(i['name']+':')
#     d1(i,i['name'])
#
# with open('baidu_map/市区1.txt', 'a+') as f:
#     for i in li:
#         f.writelines(i+'\n')
'''地区解析'''
# pip install cpca
'''读取关键字'''
# def url_list():
#     df = pd.read_excel('C:\\Users\\Administrator\\Desktop\\kk.xlsx', usecols=[1], names=None)
#     # 读取项目名称列,不要列名
#     df_li = df.values.tolist()
#     result = []
#     for s_li in df_li:
#         if s_li[0] not in result:
#             result.append(s_li[0])
#         else:
#             print('重复', s_li[0])
#     return result


# url_list()
# ss=['22','33']
# print(str(ss[0]+','+ss[1]))
'''json解析'''
import requests

cookies = {
    # 'ti_ua': 'Mozilla^%^2f5.0^%^20(Windows^%^20NT^%^2010.0^%^3b^%^20Win64^%^3b^%^20x64)^%^20AppleWebKit^%^2f537.36^%^20(KHTML,^%^20like^%^20Gecko)^%^20Chrome^%^2f94.0.4606.54^%^20Safari^%^2f537.36',
    # 'user_pref_currency': '^\\^USD^\\^',
    # 'user_pref_language': '^\\^zh-CN^\\^',
    # 'last-domain': 'www.ti.com.cn',
    # 'CONSENTMGR': 'ts:1632484316052^%^7Cconsent:true',
    # 'tiSessionID': '017c17a5d396000260b55de91a9905072005206a00bd0',
    # '_ga': 'GA1.3.598340388.1632484317',
    # '_gid': 'GA1.3.1190360084.1632484317',
    # '_gcl_au': '1.1.648276037.1632484317',
    # 'ELOQUA': 'GUID=DBB4BD201C844073A14CBFB2F4A498C6',
    # 'coveo_visitorId': 'b6e73c77-1369-4abe-a37d-c09940aa088a',
    # 'ABTasty': 'uid=8z50xf6kmj3tye9e&fst=1632484352541&pst=-1&cst=1632484352541&ns=1&pvt=2&pvis=2&th=',
    # 'da_lid': 'BCDD00D89A73EA0A417ABB990A43947B6C^|0^|0^|0',
    # 'tipage': '^%^2Ftistore^%^2Fquick^%^20add^%^20to^%^20cart-en',
    # 'tipageshort': 'quick^%^20add^%^20to^%^20cart-en',
    # 'ticontent': '^%^2Ftistore',
    # 'ACART': '99c118e1-75c8-4da9-a3cf-bb3333e0e152',
    # 'ti_geo': 'country=CN^|city=GUANGZHOU^|continent=AS^|tc_ip=183.12.86.240',
    # 'bm_sz': '7EF692D5D6F0209272A1225AEB727FE2~YAAQJOU3dNn+Jst6AQAACA2nGg0DDR4P5AfC1O8B9NsRWCKTQWA00EJWgG8GQJ5wIiR+U3PMrCi1JM+s7cyIS5T07d3GdWMo3HmkDrkBkCqCuG9PWwkTQbQQaA9G7+HJ7W2ZHCBtUacmJ9vgGBSpP+BxPO2qiEgbMsVbSTOjQma5uT5nEnfH+CL8M3fBeTWqdroVeFBl+PUnCBYzdOQzpzSN9WYofIfbfUYUIA7JcgoaOcpUWOmIRquFnj95yUy2vuUE4tJqjDyoPdcustptyuVPPBwaQZjYaAxuPsGebQTDyw==~3490882~3752760',
    # 'ga_page_cookie': 'quick^%^20add^%^20to^%^20cart-en',
    # 'ga_content_cookie': '^%^2Ftistore',
    # 'bm_mi': '3CF6EC524EFAA7013DA1A9175C09521E~63AS+7/FwoNaa/R+jyTX3kTdTXsmoKbYj6TJVKecFkPCAT3RqKyJemk9vQwpiD8HMFID6F17kxGyLCufaeREa1X+NwzjBKVmPYYpNBmthHwBobxNogjICF8pYhL4tYPmkHD2kcGs2fMIjonNqQsOyBB+AhRUdllQMIAsFaE0aRpR0519Tj3gYjNXY8L3Gr5EIonT9EL9B7mEMPgvo/ZedpcBuBhNCXD0wIsS9tZ7uNMxB/NJAO8NGyy1cLM38hz2Rsn34zuJ4hTSKjBOPpXeoGDIH2WJiuTrYKv5nUifcjJ2yAri97L/4E23EBRvtARih02q5FP9aCxzLyCnwGSPC046AswLwna1yXdG66xUBE0=',
    # 'userType': 'Anonymous',
    # 'gpn': 'Non-Product',
    # 'bm_sv': '71C918ED950A8A09085DA93324349274~i2s40X/0sjE8EnR2a2Gsw5hmVsLIRNjamLAZ3X/So5XtaQD+oW6CsKUKI/fms2HlTpVeMcXtGvxRdeT1hevHbzalEK64r+p8F6lCOE+5tagWuSQZhTLo1StJz3McBSr606ClTNGcWvC+E9iJ28dExLp3GRbFKITXbFMO1f2bjVU=',
    # 'ak_bmsc': '6740E8FD03CD6E169FA40DDC558C9C1E~000000000000000000000000000000~YAAQJ+U3dMx5Hrx6AQAAnYyoGg0nCRf5f5FbB00k7xoteEegVzQgteFWQEbmUmL8R7h3KzIi198yKtI3HvLn29IKP5Aqj09ME+Dr0cHl/KHc+DqjROFsnYhE/CznAvDyVqhncbmIPjLfwQEmmipdKgr+F3L7LH/HTmHQRaY1fEPxP+ZeXZRl3kZmJesZSsVFjfed+3NugiDbcYAxKzvznj+BTYl0RgG7zZ65qRTf517BmXqyiu2wyWVjaxfgIsDQqu9dfUuWwr9DeuWM/IHkKqLFWCfuQAqTkBvIew/4uPVw6GXmIVIC1pheTzFhEE5tKB2XHotMWGrDVwX/VKACu5QXHfQmMNQYFB+Ld9Tp2rwdOW+J2FP/AbJ08W2MKRA2XnjSARVF0jy/CRrim8AE7XdS2Yxr6GtHzbZ1+SjGTuZfHUAAG02CdHmPjhpz0MEASn6AzMhJ/jQ5lGycZbSFaP3wcL+DC/G6a4lRl3E=',
    # '_gat_ga_main_tracker': '1',
    # 'utag_main': 'v_id:017c17a5d396000260b55de91a9905072005206a00bd0^$_sn:2^$_ss:1^$_st:1632536626988^$free_trial:false^$_pn:1^%^3Bexp-session^$ses_id:1632534825856^%^3Bexp-session',
    # 'ti_rid': 'baf2b1ed',
    # 'ti_bm': 'Customer-Categorized^%^20Bot^%^20(PDP^%^20ASNs)^%^3adelay^%^3a^%^3aProblematic^%^20ASNs^%^3a0^%^3a',
    '_abck': '7AB383C460C676ECBBA9FD0CDC6FE317~-1~YAAQJOU3dFc/J8t6AQAA/9msGgajRwECKXoTALxajOpGp07rU5H8JLKWnRdQtN33rYNQE/7Ka9I6RK7eXnqnR2hmO8UXg9ZKFFq46qE2bqxQegcXNMauUzNWGINE9wYCv7+EKpm6bzZyZNlBT76Uqa6X69yiO/CkY5uPNNoMwKaRPXoydrt2g7dyVR+5ad4CIPlT1T5BF9g1sGj1x4+HcawDfOCQAy13d5cUTGgO9PehMJor7hTFHRIpkY0JIz8AWXLjpRxpXj6WsfTPAb4bcImFQFhCrFHZTHV3p6pYAJYjribZ8p9fRJcyQMaQQW8yB7vrYt+P23PR0HCgrNvlwOeC4J7P7Pn1Tr/M1+rSBT8vJ+OJqK3ZlXzZQU+MLP1I7kt0ggA3DWWiZWakszeoxhn9rkz7lvk=~0~-1~-1'
}

headers = {
    'Host': 'www.ti.com.cn',
    'Connection': 'keep-alive',
    'Content-Length': '19',
    'Pragma': 'no-cache',
    'Cache-Control': 'no-store, must-revalidate',
    'sec-ch-ua': '"Chromium";v="94", "Google Chrome";v="94", ";Not A Brand";v="99"',
    'sec-ch-ua-mobile': '?0',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36',
    'Content-Type': 'application/json',
    'X-Sec-Clge-Req-Type': 'ajax',
    'Expires': '0',
    'sec-ch-ua-platform': '"Windows"',
    'Accept': '*/*',
    'Origin': 'https://www.ti.com.cn',
    'Sec-Fetch-Site': 'same-origin',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Dest': 'empty',
    'Referer': 'https://www.ti.com.cn/zh-cn/ordering-resources/buying-tools/quick-add-to-cart.html',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'zh-CN,zh;q=0.9',

}

# data = '[SN74LVC1G79DBVT]'

# response = requests.post('https://www.ti.com.cn/storeservices/cart/inventory', headers=headers, cookies=cookies, verify=False, data=data)
# print(response.text)
